package cn.kgm.user.dto.dto;

import cn.kgm.core.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * # 技术改变自己 #
 * 用户账户表
 * @author kappi
 * @date   2024-04-08 13:28:48
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "UserAccountSaveDTO", description = "用户账户表")
public class UserAccountSaveDTO extends Entity<Long> {

    /**
     * 用户ID:[user.id]
     */
    @ApiModelProperty(value = "用户ID:[user.id]", position = 2)
    @NotNull(message = "用户ID:[user.id]不能为空")
    private Long userId;

    /**
     * 账户类型:[PHONE,手机号];[EMAIL,邮箱]
     */
    @ApiModelProperty(value = "账户类型:[PHONE,手机号];[EMAIL,邮箱]", position = 3)
    @Size(max = 16, message = "账户类型:[PHONE,手机号];[EMAIL,邮箱]长度不能超过16")
    @NotBlank(message = "账户类型:[PHONE,手机号];[EMAIL,邮箱]不能为空")
    private String type;

    /**
     * 登录账号
     */
    @ApiModelProperty(value = "登录账号", position = 4)
    @Size(max = 32, message = "登录账号长度不能超过32")
    @NotBlank(message = "登录账号不能为空")
    private String value;

    /**
     * 密码加密CODE
     */
    @ApiModelProperty(value = "密码加密CODE", position = 5)
    @Size(max = 32, message = "密码加密CODE长度不能超过32")
    @NotBlank(message = "密码加密CODE不能为空")
    private String salt;

    /**
     * 加密密码
     */
    @ApiModelProperty(value = "加密密码", position = 6)
    @Size(max = 32, message = "加密密码长度不能超过32")
    @NotBlank(message = "加密密码不能为空")
    private String password;

    /**
     * 是否密码锁定区间:[0,未锁定];[1,锁定]
     */
    @ApiModelProperty(value = "是否密码锁定区间:[0,未锁定];[1,锁定]", position = 7)
    @NotNull(message = "是否密码锁定区间:[0,未锁定];[1,锁定]不能为空")
    private Boolean passLock;

    /**
     * 密码锁定结束时间
     */
    @ApiModelProperty(value = "密码锁定结束时间", position = 8)
    @NotNull(message = "密码锁定结束时间不能为空")
    private LocalDateTime lockEndTime;

}
